package Logicamente;
import java.awt.BorderLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaEsperar1 extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JPanel jPanel1;
	private JButton jButton1;
	private JLabel jLabel2;
	private JLabel jLabel1;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaEsperar1 inst = new VentanaEsperar1(0, 0, null, null);
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaEsperar1(int tiempoT, int respCorrectas, Usuario u, Partida p) {
		super();
		setTitle("Logicamente");
		setIconImage(Toolkit.getDefaultToolkit().getImage(VentanaDatosPartida.class.getResource("/Imagenes/L.png")));
		initGUI(tiempoT,respCorrectas,u,p);
	}
	
	private void initGUI(final int tiempoT,final int respCorrectas,final Usuario u,final Partida p) {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setLayout(null);
				jPanel1.setPreferredSize(new java.awt.Dimension(549, 435));
				{
					jLabel1 = new JLabel();
					jPanel1.add(jLabel1);
					jLabel1.setText("Espere mientras los otros jugadores finalizan sus partidas");
					jLabel1.setBounds(34, 12, 429, 23);
					jLabel1.setFont(new java.awt.Font("Segoe UI",3,16));
				}
				{
					jLabel2 = new JLabel();
					jPanel1.add(jLabel2);
					jLabel2.setBounds(0, 41, 494, 363);
					jLabel2.setSize(500, 280);
					jLabel2.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/mike.gif")));
				}
				{
					jButton1 = new JButton();
					jPanel1.add(jButton1);
					jButton1.setText("AVANZAR");
					jButton1.setBounds(204, 327, 82, 19);
					jButton1.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent evt) {
							jRadioButton_crearActionPerformed(tiempoT,respCorrectas,u, p);
						}
					});
				}
			}
			pack();
			this.setSize(516, 392);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
		
		
	}
	
	protected void jRadioButton_crearActionPerformed(int tiempoT , int respCorrectas,Usuario u,Partida p) {
		VentanaFinDeJuego v = new VentanaFinDeJuego(tiempoT,respCorrectas,u,p);
        v.setLocationRelativeTo(null);
        v.setVisible(true);                    
        this.setVisible(false);
        this.hide(); 
	}

}
